package com.glsc.ngateway.common.base.repo.mysql.gateway.other;

import com.glsc.ngateway.common.base.domain.mysql.gateway.other.TagProdRel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface TagProdRefRepository extends JpaRepository<TagProdRel, Integer>, JpaSpecificationExecutor<TagProdRel> {
    @Transactional
    @Modifying
    @Query(value = "delete from TagProdRel u where u.tagId = :tagId")
    void deleteByTagId(@Param("tagId") Integer tagId);
}



